package com.kws.merchant.mapper;

import com.kws.merchant.domain.Target;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * 商家-指标(Target)表数据库访问层
 *
 * @author yxy
 * @since 2024-11-04 11:39:02
 */

public interface TargetMapper extends BaseMapper<Target> {

    /**
     * 查询商家相关指标
     * @return
     * @param userId
     */
    @Select("select t.* from tb_target t left join tb_merchant_target m on t.id=m.target_id where m.merchant_id=\"${userId}\"")
    List<Target> getMerchantByList(@Param("userId") Long userId);
}
